package cn.myjerry.thread.status;

public class YieldDemo01 extends Thread {

	@Override
	public void run() {
		for(int i=0;i<100;i++) {
			System.out.println("yuild..." + i);
		}
	}
	
	public static void main(String[] args) {
		YieldDemo01 demo = new YieldDemo01();
		Thread t = new Thread(demo);
		t.start();
		
		for(int i=0;i<100;i++) {
			if(i%20 == 0) {
				Thread.yield();
			}
			System.out.println("main..." + i);
		}
	}
	
}
